﻿public class KnapsackItem : IKnapsackItem
{
    public long id;
    public bool isSuperposition;
    public int number;

    public int GetFixedId()
    {
        return (int)(id >> 32);
    }

    public long GetId()
    {
        return id;
    }

    public int GetItemId()
    {
        return (int)id;
    }

    public bool IsSuperposition()
    {
        return isSuperposition;
    }

    public int GetNumber()
    {
        return number;
    }

    public void SetItemId(int ID)
    {
        if(GetFixedId()==0)
        {
            id = (id << 32) + ID;
        }
    }

    public void SetNumber(int number)
    {
        this.number = number;
    }
}
